package com.chinairi.mall.controller;


import com.chinairi.common.utils.ResponseUtil;
import com.chinairi.mall.model.ServiceShelfGoodsType;
import com.chinairi.mall.model.ServiceShelfPriceAdd;
import com.chinairi.mall.model.ServiceShelfPriceMulti;
import com.chinairi.mall.service.IServiceShelfGoodsTypeService;
import com.chinairi.mall.service.modelobject.ServiceTypeMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.chinairi.common.controller.BaseController;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 服务_商品分类表 前端控制器
 * </p>
 *
 * @author Webgasd
 * @since 2020-09-18
 */
@RestController
@RequestMapping("/service-shelf-goods-type")
public class ServiceShelfGoodsTypeController extends BaseController {
    @Autowired
    private IServiceShelfGoodsTypeService iServiceShelfGoodsTypeService;

    /**
     * 根据服务小类查找小类中的所有商品类别分类
     *
     * @param sgtSerClassCode 服务小类编号
     * @throws IOException 异常
     */
    @GetMapping("/getAddListBySgtSerClassCode")
    public void getAddListBySgtSerClassCode(String sgtSerClassCode) throws IOException {
        List<ServiceShelfPriceAdd> list = iServiceShelfGoodsTypeService.getTypeAddList(sgtSerClassCode);
        ResponseUtil.showMessage("success", "查询成功", list);
    }

    /**
     * 根据服务小类查找小类中的所有商品类别分类
     *
     * @param sgtSerClassCode 服务小类编号
     * @throws IOException 异常
     */
    @GetMapping("/getMultiListBySgtSerClassCode")
    public void getMultiListBySgtSerClassCode(String sgtSerClassCode) throws IOException {
        List<ServiceShelfPriceMulti> list = iServiceShelfGoodsTypeService.getTypeMultiList(sgtSerClassCode);
        ResponseUtil.showMessage("success", "查询成功", list);
    }
}
